<template>
  <div class="page-view">
    <!--        <router-view :key="key"/>-->
    <keep-alive>
      <transition name="fade-transform" mode="out-in">
        <router-view v-if="$route.meta.keepAlive" :key="key"/>
      </transition>
    </keep-alive>
    <transition name="fade-transform" mode="out-in">
      <router-view v-if="!$route.meta.keepAlive" :key="key"/>
    </transition>
  </div>
</template>

<script>
  export default {
    name: 'PageView',
    computed: {
      key () {
        return this.$route.path
      }
    }
  }
</script>

<style lang="less" scoped>
  .page-view {
    position: relative;
    width: 100%;
    height: 100%;
  }
</style>
